package fr.imag.m2pgi.m2m.geoloc;

import java.io.IOException;
import java.util.ArrayList;

import fr.imag.m2pgi.m2m.geoloc.scip.SCIP20;

public class LidarSCIP20 implements Lidar {
  
  private SCIP20 laser;
  
  public LidarSCIP20(SCIP20 laser) {
    this.laser = laser;
  }

  public boolean isEnabled() throws IOException {
    return laser.getState();
  }

  public void enable() throws IOException {
    laser.enableLaser();
  }

  public void disable() throws IOException {
    laser.disableLaser();
  }

  public int getRange(double angle) throws IOException {
      return laser.getDistance(angle);
  }

  public ArrayList<Integer> getMeasures() throws IOException {
    return laser.getTwoCharLastMeasure();
  }

  public int getRange(ArrayList<Integer> data, double angle) throws IOException {
    return laser.getDistance(data, angle);
  }

}
